package org.jeecg.modules.rental.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.rental.entity.RentalOrder;

import java.util.List;

/**
 * @Description: 租赁订单
 * @Author: sean
 * @Date:   2024-06-17
 * @Version: V1.0
 */
public interface RentalOrderMapper extends BaseMapper<RentalOrder> {

    /**
     * 按照条件查找订单，有多条订单，就使用最后一条记录
     * @param ew
     * @return
     */
    RentalOrder lastOrder(@Param("ew") QueryWrapper<RentalOrder> ew);

    List<RentalOrder> getOrderByUseId(@Param("accountId") String accountId, @Param("orderType") Integer orderType, @Param("orderStatus") Integer orderStatus);

    RentalOrder  getOrderByCode(@Param("orderCode") String orderCode);

//    List<IncomeTrendVo> incomeTrend(@Param("ew") QueryWrapper<RentalOrder> eq, @Param("days") Integer days);

}
